home *** CD-ROM | disk | FTP | other *** search
- Path: bright.ecs.soton.ac.uk!postmaster
- From: Martin Brown <mqb@ecs.soton.ac.uk>
- Newsgroups: comp.lang.c
- Subject: Re: Character String --> Integer
- Date: Thu, 08 Feb 1996 10:16:21 +0000
- Organization: Southampton University
- Message-ID: <3119CD75.198C@ecs.soton.ac.uk>
- References: <4fb0ga$lsa@remus.rutgers.edu>
- NNTP-Posting-Host: horus.ecs.soton.ac.uk
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (X11; I; SunOS 5.3 sun4c)
-
- How about sscanf() which reads from a string rather than
- a file. So it would be something like:
-
- int num;
- char read_string[100];
-
- if ((sscanf(read_string, "%d", &num)) == 1)
-
- /* do something */
-